package com.gxa.p2p.util;

import com.gxa.p2p.businessExceptionCode.ErrorCode;
import com.gxa.p2p.controller.MailController;
import com.gxa.p2p.exception.BusinessException;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Map;

public class CompareCodeUtil {
    public Map<String, Object> compare(String mapcode, String code) {
        System.out.println("mapcode:"+mapcode);
        System.out.println("code:"+code);

//      SendMailUtil sendMailUtil=new SendMailUtil();
//        Integer code = sendMailUtil.getCode();
//        System.out.println("1:"+code);
        MapUtil mapUtil=new MapUtil();
        if ((mapcode).equals(code)){
            System.out.println("000000000000000000000000");
            mapUtil.put("code", 0);
            mapUtil.put("msg", "验证邮箱成功，可以继续操作");
        } else {
            System.out.println("99999999999999999999999999999");
            throw new BusinessException(ErrorCode.FAILED);
        }
        return mapUtil.getMap();
    }
}
